package com.xnyzc.lhy.common.component.controller.common;

import com.xnyzc.lhy.common.entity.Rv;
import com.xnyzc.lhy.common.penum.EErrorCode;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Description:
 * @Author: scootXin
 * @Date: 2018/12/14 16:53
 */
@Api(description = "错误提示接口")
@RestController
@RequestMapping("/error")
public class ErrorController {
    @ResponseBody
    @RequestMapping(value = "/400")
    public Rv error_400() {
        return Rv.wrap(EErrorCode.missingArg, null);
    }

    @ResponseBody
    @RequestMapping(value = "/401")
    public Rv error_401() {
        return Rv.wrap(EErrorCode.authErr, null);
    }

    @ResponseBody
    @RequestMapping(value = "/403")
    public Rv error_403() {
        return Rv.wrap(EErrorCode.authDenied, null);
    }

    @ResponseBody
    @RequestMapping(value = "/404")
    public Rv error_404() {
        return Rv.wrap(EErrorCode.c404, null);
    }

    @ResponseBody
    @RequestMapping(value = "/500")
    public Rv error_500() {
        return Rv.wrap(EErrorCode.c500, null);
    }
}
